home *** CD-ROM | disk | FTP | other *** search
- PROGRAM labels ;
-
- { GEM program to create labels of any size - uses menu and
- forms to allow user to select size and font settings then
- edit a form }
-
- { for ATARI 520ST computer with printer }
- { version for GEMINI 10X printer - see control codes below }
-
- { by Ron Rautenberg Feb/Mar 1986
- 15 San Juan Dr
- Salinas, Ca 93901
- 408-757-6481 }
-
- { VERSION 1.1
- MODIFIED
- 16 Mar - check for printer offline b4 printing
- - remove comments from Delete_Dialog to free space
- 17 Mar - lots of cosmetic improvements
- box around label
- works in low,med res - should work in high
-
- }
-
- CONST
- {$I GEMCONST.PAS}
-
- { printer control codes - modify these for your printer }
- { format of the strings is paramount!! - decimal codes separated by commas }
- { ONLY ascii values in the range 0-127 acceptable }
-
- { used to check if a print style is available - as set by LMINSTAL.PRG }
- MARKER = '99,99,99';
-
- { Program LMINSTAL will modify these }
- { Software Reset }
- SW_RESET = '27,64,00';
-
- { Normal print mode - 10 cpi should be done by SW_RESET }
- NORMPRT = '27,66,01';
- { Elongated print - or double wide }
- ELONGPRT = '27,87,01';
- { Condensed print }
- CONDPRT = '27,15,00';
-
- { To select 8 lines per inch }
- EIGHTPER = '27,48,00';
- { To select 6 lines per inch }
- SIXPER = '27,50,00';
-
- { Turn underline mode on }
- UL_ON = '27,45,01';
- { Turn underline mode off }
- UL_OFF = '27,45,00';
- { Turn italics on }
- ITALIC_ON = '27,52,00';
- { Italics off }
- ITALIC_OFF = '27,53,00';
- { Bold or Emphasized print - you may use double strike }
- BOLD_ON = '27,69,00';
- { To cancel Bold print }
- BOLD_OFF = '27,70,00';
-
- MAGIC = '$3ABH'; { To allow install pgm to find constants }
-
- CPI_COND = 17; { chars per inch - condensed mode }
- CPI_NORM = 10; { normal }
- CPI_ELON = 5; { elongated or double wide }
-
- LPI_NORM = 6; { standard lines per inch }
- LPI_COND = 8; { condensed lines per inch }
-
- MAXLINES = 15; { maximum size of form }
- MAXCHARS = 70;
-
- DESK_TITLE = 3;
-
- TYPE
- {$I gemtype.pas}
-
- VAR
-
- { menu items must all be globals !!!}
-
- the_menu : Menu_Ptr; { pointer to the menu itself }
-
- lab_title,
- style_title, { the menu titles }
- siz_title,
-
- lab_make,
- lab_remake,
- lab_print, { the items under the label title }
- lab_quit,
-
- pri_cond,
- pri_norm,
- pri_elon, { the items under the printer title }
- pri_ital,
- pri_bold,
- pri_underline,
-
- siz_small,
- siz_large, {the items under the size title }
- siz_square,
- siz_other : integer;
-
- numlines, { number of printed lines per label }
- totlines, { total number of lines on a label }
- numchars, { number of chars per line }
-
- cpi,lpi, { chars per inch, lines per inch }
-
- print_size, { the actual user selected values }
- label_size: integer;
-
- label_len,label_wid : real ;
-
- bold,ital,underline : boolean; { style states - on or off }
-
- { the actual lines to print }
- print_line : array[1..MAXLINES] of string[255];
-
- msg : Message_Buffer; { the message returned when menu item sel. }
-
- init_wid,init_len : str255; { initial values for <other> in sizes }
-
- dummy,which : integer ;
-
- { *************************************************************************** }
-
- {$I gemsubs} { GEM subroutines }
-
- FUNCTION Get_Rez : integer ; { xbios call to get screen resolution }
- XBIOS( 4 ) ;
- function C_Prnos : boolean;
- GEMDOS ( 17 );
-
- { *************************************************************************** }
-
- function xor(b1,b2:boolean) : boolean; { logical xor function }
- begin
- xor := (b1 or b2) and not (b1 and b2);
- end;
-
- { *************************************************************************** }
-
- procedure set_size;
-
- var i : integer;
-
- begin
- { calculate number of lines in label }
- totlines := round(label_len * lpi);
- numlines := totlines - 2;
- if numlines > MAXLINES then numlines := MAXLINES;
- numchars := round( (label_wid - 0.3) * cpi ) ;
- if numchars > MAXCHARS then numchars := MAXCHARS;
- { chop off print_lines if necessary }
- for i := 1 to numlines do
- if Length(print_line[i]) > numchars then print_line[i,0] := chr(numchars);
- end;
-
-
- { *************************************************************************** }
-
- procedure show_info; { Tell 'em about me }
-
- var msg : str255;
- ok : integer;
-
- begin
- msg := '[0][ Label Maker ver 1.1 |';
- msg := concat(msg,' public domain| |');
- msg := concat(msg,' by Ron Rautenberg| ][ OK ]');
-
- ok := Do_Alert(msg,1);
- end;
-
- { *************************************************************************** }
-
- procedure initialize; { initialize the globals }
-
- var i : integer;
-
- begin
- Init_mouse;
- Set_mouse(M_arrow);
-
- print_size := pri_norm;
- label_size := siz_small;
-
- bold := false;
- ital := false;
- underline := false;
-
- init_wid := ''; { initial values for strings in size 'other' }
- init_len := '';
-
- label_len := 1.0;
- label_wid := 3.5;
- lpi := LPI_NORM;
- cpi := CPI_NORM;
- set_size;
- for i := 1 to MAXLINES do
- print_line[i] := '';
- end;
-
- { *************************************************************************** }
-
- function stoi( s : str255 ) : integer; { convert string s to integer }
- { assumes s contains only numeric digits }
- var val,i : integer ;
-
- begin
- val := 0;
- for i := 1 to Length( s ) do
- val := val * 10 + ord( s[i] ) - ord ( '0' );
- stoi := val;
- end;
-
- { *************************************************************************** }
-
- procedure show_edit_funcs;
- { shows form edit functions available to user }
-
- var help_box : dialog_ptr; { the form itself }
- i,
- ok_button, { the exit button }
- pushed : integer; { button the user pushed }
-
- item : array[1..7] of integer; { the text lines }
- line : array[1..7] of string[48];
-
- begin
-
- { initialize the lines }
- line[1] := ' EDIT FUNCTIONS';
- line[2] := '';
- line[3] := 'Esc - Erases entire line';
- line[4] := 'arrows - Move up/down lines';
- line[5] := 'arrows - Move left/right';
- line[6] := 'Delete - Erase character right';
- line[7] := 'Backspace - Erase character left';
-
- { create the object }
- help_box := New_Dialog(9,0,0,38,11);
-
- { add the text lines }
- for i := 1 to 7 do begin
- item[i] := Add_DItem(help_box,G_String,None,2,i,48,1,0,0);
- Set_Dtext(help_box,item[i],line[i],System_font,TE_Left);
- end;
-
- { add an ok button }
- ok_button := Add_Ditem(help_box,G_Button,
- Selectable | Exit_Btn | Default,15,9,8,1,0,0);
- set_Dtext(help_box,ok_button,'OK',System_font,TE_Center);
-
- { reserve room to center the dialog }
- Center_dialog(help_box);
-
- { display the box }
- pushed := Do_Dialog(help_box,0);
-
- { erase it }
- End_dialog(help_box);
-
- { release the space }
- Delete_Dialog(help_box);
- end;
-
-
- { *************************************************************************** }
-
- function get_copies : integer;
- { how many copies does user want? }
-
- const
- PROMPT1 = ' Ensure Printer is On-line ';
- PROMPT2 = 'How many copies?';
-
- var copies_box : dialog_ptr; { the form itself }
- prompt_item, { the prompts }
- print_button, { the exit buttons }
- abort_button,
- line, { the edit line }
- pushed : integer; { button the user pushed }
-
- num_str : str255 ;
-
- begin
-
- { create the object }
- copies_box := New_Dialog(6,0,0,31,10);
-
- { add the prompt }
- prompt_item := Add_Ditem(copies_box,g_boxtext,None,
- 2,1,27,2,-1,(256+4096)*BLACK+128);
- set_Dtext(copies_box,prompt_item,PROMPT1,System_font,TE_Center);
- prompt_item := Add_Ditem(copies_box,g_text,None,2,4,27,1,0,256*BLACK+128);
- set_Dtext(copies_box,prompt_item,PROMPT2,System_font,TE_Center);
-
- { add an ok button }
- print_button := Add_Ditem(copies_box,G_Button,
- Selectable | Exit_Btn | Default,4,8,8,1,0,0);
- set_Dtext(copies_box,print_button,'PRINT',System_font,TE_Center);
- abort_button := Add_Ditem(copies_box,G_Button,
- Selectable | Exit_Btn ,19,8,8,1,0,0);
- set_Dtext(copies_box,abort_button,'ABORT',System_font,TE_Center);
-
- { add edit lines }
- line := Add_Ditem(copies_box,G_Ftext,None,
- 2,6,26,1,0,256*Black + 128 );
- set_Dedit(copies_box,line,'____','9999','1',
- System_font,TE_Center);
-
- { reserve room to center the dialog }
- Center_dialog(copies_box);
-
- { display the box }
- pushed := Do_Dialog(copies_box,line);
-
- { erase it }
- End_dialog(copies_box);
-
- if pushed = print_button then begin
- { find out what was entered }
- Get_DEdit(copies_box,line,num_str);
-
- { convert to integer and return }
- get_copies := stoi(num_str);
- end
- else get_copies := 0;
-
- { release the space }
- Delete_Dialog(copies_box);
- end;
-
- { *************************************************************************** }
-
- procedure send_control(code:str255);
- { sends printer control codes based on code string which is a
- string of decimal digits separated by commas }
-
- var
- str,num_str,control : str255;
- comma,number,i : integer;
- prt : text;
-
- begin
- rewrite(prt,'lst:');
-
- control := ''; { init control string }
- code := concat(code,','); { tack a comma on end }
- str[0] := chr(1); { set length of temp string }
- loop
- comma := pos(',',code); { find position of 1st comma }
- exit if (comma = 0);
- num_str := copy(code,1,comma-1); { move digits to temp }
- delete(code,1,comma); { delete 1st number from string }
- number := stoi(num_str); { convert it to int }
- str[1] := chr(number); { and back to character }
- control := concat(control,str); { and stick on end of control str }
- end;
-
- { send it all to printer }
- if C_Prnos then write(prt,control);
- end;
-
- { *************************************************************************** }
-
- procedure set_printer; { sends controls to set printer to proper config }
-
- var mag : string[5]; { dummy for LMINSTALL }
-
- begin
- mag := MAGIC; { So LMINSTALL can find us }
-
- send_control(SW_RESET);
-
- case cpi of { chars per inch }
- CPI_COND : send_control(CONDPRT);
- CPI_NORM : send_control(NORMPRT);
- CPI_ELON : send_control(ELONGPRT);
- otherwise : ;
- end;
-
- case lpi of { lines per inch }
- LPI_NORM : send_control(SIXPER);
- LPI_COND : send_control(EIGHTPER);
- otherwise : ;
- end;
-
- if bold then { bold }
- send_control(BOLD_ON)
- else if BOLD_ON <> MARKER then { turn off bold in case it was on }
- send_control(BOLD_OFF); { only if it could have been on }
-
- if ital then { ditto italics }
- send_control(ITALIC_ON)
- else if ITALIC_ON <> MARKER then
- send_control(ITALIC_OFF);
-
- if underline then { ditto underline }
- send_control(UL_ON)
- else if UL_ON <> MARKER then
- send_control(UL_OFF);
- end;
-
- { *************************************************************************** }
-
- procedure print_label;
- { print the labels }
-
- var head,foot, { number of space lines to print }
- line,copy, { loop control vars }
- num_copies : integer;
- error : real; { difference between actual size of label and }
- { the amount of output - cummulative }
- printer : text ;
- pushed : integer;
-
- begin
- rewrite(printer,'lst:');
- num_copies := get_copies;
- if num_copies > 0 then begin
- pushed := 1;
- if not C_Prnos then { if the printer isn't ready }
- pushed := Do_Alert('[2][ Check Printer... | ][ OK | ABORT ]',1);
- if (pushed = 1) and C_Prnos then begin
- set_printer;
- head := round((totlines - numlines)/2);
- foot := totlines - numlines - head;
- error := 0.0;
- for copy := 1 to num_copies do begin
- error := error+label_len - (totlines / lpi); { add to error value }
- for line := 1 to head do writeln(printer); { header space }
-
- { print extra header line if error > half a line }
- if error > (0.5 / lpi) then begin
- writeln(printer);
- error := error - ( 1.0 / lpi ); { and reduce the error }
- end;
-
- for line := 1 to numlines do begin { put the label lines }
- set_printer; { every line - some codes turned off by CR }
- writeln(printer,print_line[line]);
- end;
-
- for line := 1 to foot -1 do writeln(printer); { footer space }
-
- { a full footer only if the error > negative half a line }
- if error > (-0.5 / lpi) then writeln(printer)
- else error := error + ( 1.0 / lpi);
-
- end; { for copy }
- end; { if pushed }
- end; { if copies > 0 }
- end;
-
- { *************************************************************************** }
-
- procedure make_menu ;
- { create the menu bar }
-
- var lab_blank1,
- lab_blank2,
- pri_blank : integer;
-
- begin
-
- { reserve memory for the menu }
- the_menu := New_Menu(30,' About Labels ') ;
-
- { add the titles }
- lab_title := Add_MTitle(the_menu,' label ');
- style_title := Add_MTitle(the_menu,' style ');
- siz_title := Add_MTitle(the_menu,' size ');
-
- { add the items to <labels> }
- lab_make := Add_MItem(the_menu,lab_title,' create ');
- lab_remake := Add_MItem(the_menu,lab_title,' modify ');
- lab_blank1 := Add_MItem(the_menu,lab_title,'-------------');
- lab_print := Add_MItem(the_menu,lab_title,' print ');
- lab_blank2 := Add_MItem(the_menu,lab_title,'-------------');
- lab_quit := Add_MItem(the_menu,lab_title,' quit ');
-
- { add the items to <printer> }
- pri_cond := Add_MItem(the_menu,style_title,' compressed ');
- pri_norm := Add_MItem(the_menu,style_title,' pica ');
- pri_elon := Add_MItem(the_menu,style_title,' elongated ');
- pri_blank:= Add_MItem(the_menu,style_title,'---------------');
- pri_bold := Add_MItem(the_menu,style_title,' bold ');
- pri_ital := Add_MItem(the_menu,style_title,' italics ');
- pri_underline := Add_Mitem(the_menu,style_title,' underlined ');
-
- { add the items to <size> }
- siz_small := Add_MItem(the_menu,siz_title,' 3.5" x 1" ');
- siz_large := Add_MItem(the_menu,siz_title,' 4" x 1.5" ');
- siz_square := Add_MItem(the_menu,siz_title,' 2.75" x 2.75" ');
- siz_other := Add_MItem(the_menu,siz_title,' other ');
-
- { check mark the defaults }
- Menu_Check(the_menu,pri_norm,TRUE);
- Menu_Check(the_menu,siz_small,TRUE);
-
- { disable the blank lines }
- Menu_Disable(the_menu,lab_blank1);
- Menu_Disable(the_menu,lab_blank2);
- Menu_Disable(the_menu,pri_blank);
- if CONDPRT = MARKER then Menu_Disable(the_menu,pri_cond);
- if ELONGPRT= MARKER then Menu_Disable(the_menu,pri_elon);
- if BOLD_ON = MARKER then Menu_Disable(the_menu,pri_bold);
- if ITALIC_ON = MARKER then Menu_Disable(the_menu,pri_ital);
- if UL_ON = MARKER then Menu_Disable(the_menu,pri_underline);
- end;
-
- { *************************************************************************** }
-
- procedure get_lab_size ( var width, len : real );
- { user selected <other> for label size }
-
- const PROMPT = 'Enter label size';
-
- var size_box : dialog_ptr; { the form itself }
- i,
- prompt_item, { the prompt }
- ok_button, { the exit button }
- help_button, { the help button }
- linew,linel, { the edit lines - width and length }
- pushed, { button the user pushed }
- whole,frac : integer; { whole and fractional part of number entered }
-
- str : str255 ;
-
- begin
-
- { create the object }
- size_box := New_Dialog(6,0,0,34,10);
-
- { add the prompt }
- prompt_item := Add_Ditem(size_box,g_text,None,7,1,20,1,0,256*BLACK+128);
- set_Dtext(size_box,prompt_item,PROMPT,System_font,TE_Center);
-
- { add an ok button }
- ok_button := Add_Ditem(size_box,G_Button,
- Selectable | Exit_Btn | Default,5,8,8,1,0,0);
- set_Dtext(size_box,ok_button,'OK',System_font,TE_Center);
-
- { add a help button }
- help_button := Add_Ditem(size_box,G_Button,
- Selectable | Exit_Btn ,21,8,8,1,0,0);
- set_Dtext(size_box,help_button,'HELP',System_font,TE_Center);
-
- { add edit lines }
- linel := Add_Ditem(size_box,G_Ftext,None,
- 7,3,20,1,0,256*Black + 128 );
- set_Dedit(size_box,linel,'length : _.__ inches','999',init_len,
- System_font,TE_Center);
- linew := Add_Ditem(size_box,G_Ftext,None,
- 7,5,20,1,0,256*Black + 128 );
- set_Dedit(size_box,linew,' width : _.__ inches','999',init_wid,
- System_font,TE_Center);
-
- repeat
- Center_dialog(size_box); { reserve room to center the dialog }
-
- pushed := Do_Dialog(size_box,linel); { display the box }
-
- End_dialog(size_box); { erase it }
-
- if pushed = help_button then begin
- Obj_SetState(size_box,help_button,Normal,FALSE);
- show_edit_funcs;
- end;
- until pushed = ok_button;
-
- { find out what was entered for width }
- Get_DEdit(size_box,linew,init_wid);
-
- { convert width to real }
- init_wid[0] := chr(3);
- for i := 1 to 3 do
- if not(init_wid[i] in ['1'..'9'] ) then
- init_wid[i] := '0';
-
- str := copy(init_wid,1,1);
- whole := stoi(str);
- str := copy(init_wid,2,2);
- frac := stoi(str);
- width := whole + frac / 100 ;
-
- { find out what was entered for length }
- Get_DEdit(size_box,linel,init_len);
-
- { convert length to real }
- init_len[0] := chr(3);
- for i := 1 to 3 do
- if not(init_len[i] in ['1'..'9']) then
- init_len[i] := '0';
-
- str := copy(init_len,1,1);
- whole := stoi(str);
- str := copy(init_len,2,2);
- frac := stoi(str);
- len := whole + frac / 100 ;
-
- { release the space }
- Delete_Dialog(size_box);
- end;
-
- { *************************************************************************** }
-
- procedure get_label(lines,chars,which:integer) ;
- { gets lines of input from user }
- { number of lines and length is determined by menu bar settings }
-
- const
- prompt = 'Design your label';
- PROMPT_LEN = 30;
-
- MAX_WID_FORM = 80; { screen size }
- MAX_HGT_FORM = 23;
- MIN_WID_FORM = 36;
- MIN_HGT_FORM = 7;
-
- BUTTON_LEN = 8;
- BUTTON_HGT = 1;
-
- var label_box : dialog_ptr; { the form itself }
- prompt_item, { the prompt }
- border, { border box }
- ok_button,help_button, { the exit buttons }
- pushed, { which button the user pushed }
- form_wid, { width of the form }
- form_hgt, { height of the form }
- i : integer; { loop controlled var }
-
- line : array[1..MAXLINES] of integer; { the forms input lines }
- template,valid,init : string[MAXCHARS]; { form setup strings }
-
- begin
- { set up the form size }
- form_wid := chars + 10;
- if form_wid < MIN_WID_FORM then
- form_wid := MIN_WID_FORM
- else if form_wid > MAX_WID_FORM then
- form_wid := MAX_WID_FORM;
-
-
- form_hgt := lines + 8 ;
- if form_hgt < MIN_HGT_FORM then
- form_hgt := MIN_HGT_FORM
- else if form_hgt > MAX_HGT_FORM then
- form_hgt := MAX_HGT_FORM;
-
- if (lines < 1) or (chars < 1) then
- pushed := Do_Alert(
- '[3][ Label dimensions | are too small ][ OK ]',1)
- else if (Get_Rez = 0) and (form_wid > 40) then
- pushed := Do_Alert(
- '[3][ Label is too big | for low resolution ][ OK ]',1)
- else begin
-
- { create the object }
- label_box := New_Dialog(lines + 6,0,0,
- form_wid,form_hgt);
-
- { add the prompt }
- prompt_item := Add_Ditem(label_box,g_text,None,
- (form_wid-PROMPT_LEN)DIV 2,1,
- PROMPT_LEN,1,0,256*BLACK+128);
- set_Dtext(label_box,prompt_item,PROMPT,System_font,TE_Center);
-
- { add a border box for the label }
- border := Add_Ditem(label_box,G_Ibox,None,
- (form_wid-(chars+2)) div 2,3,chars+2,lines+2,1,4096*Black);
-
- { add an ok button }
- ok_button := Add_Ditem(label_box,G_Button,
- Selectable | Exit_Btn | Default,8,
- form_hgt-2,BUTTON_LEN,BUTTON_HGT,0,0);
- set_Dtext(label_box,ok_button,'OK',System_font,TE_Center);
-
- { add a help button }
- help_button := Add_Ditem(label_box,G_Button,Selectable | Exit_Btn,
- form_wid-8-BUTTON_LEN,form_hgt-2,
- BUTTON_LEN,BUTTON_HGT,0,0);
- set_Dtext(label_box,help_button,'HELP',System_font,TE_Center);
-
- { set up template and validation strings }
- template :=
- '______________________________________________________________________';
- valid :=
- 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
- valid[0] := chr(chars);
- template[0] := chr(chars);
-
- { add edit lines }
- for i := 1 to lines do
- begin
- line[i] := Add_Ditem(label_box,G_Ftext,None,
- 1,3+i,form_wid - 2,1,0,
- 256*Black + 128 );
- if which = lab_remake then
- init := print_line[i]
- else
- init := '';
- set_Dedit(label_box,line[i],template,valid,init,
- System_font,TE_Center);
- end;
-
- repeat
- { reserve room to center the dialog }
- Center_dialog(label_box);
-
- { display the box }
- pushed := Do_Dialog(label_box,line[1]);
-
- { erase it }
- End_dialog(label_box);
-
- { find out what was entered }
- for i := 1 to lines do
- Get_DEdit(label_box,line[i],print_line[i]);
-
- if pushed = help_button then begin
- Obj_SetState(label_box,help_button,Normal,FALSE);
- which := lab_remake;
- show_edit_funcs;
- end;
-
- until pushed = ok_button;
-
- { release the space }
- Delete_Dialog(label_box);
-
- end; { else begin }
-
- end; {of procedure get_label }
-
- { *************************************************************************** }
- { main program }
-
- BEGIN
- IF Init_Gem >= 0 THEN
- BEGIN
-
- make_menu;
- Draw_menu(the_menu);
-
- initialize;
-
- REPEAT
- { wait for message from GEM - menu selection }
- which := Get_Event( E_Message, 0, 0, 0, 0,
- false, 0, 0, 0, 0, false, 0, 0, 0, 0, msg,
- dummy, dummy, dummy, dummy, dummy, dummy ) ;
- { un-highlight it }
- Menu_Normal(the_menu,msg[3]);
- { desk }
- if msg[3] = DESK_TITLE then
- show_info
- { label }
- else if msg[3] = lab_title then begin
- { get labels or print 'em }
- if (msg[4] = lab_make) or (msg[4] = lab_remake) then
- get_label(numlines,numchars,msg[4])
- else if msg[4] = lab_print then
- print_label;
- end { begin - lab_title }
- { styles }
- else if msg[3] = style_title then begin
- if msg[4] in [pri_cond..pri_elon] then begin
- { uncheck the old one }
- Menu_Check(the_menu,print_size,FALSE);
- print_size := msg[4];
- { check the new one }
- Menu_Check(the_menu,print_size,TRUE);
-
- case (msg[4] - pri_cond) of
- 0: begin
- cpi := CPI_COND;
- lpi := LPI_COND;
- end;
- 1: begin
- cpi := CPI_NORM;
- lpi := LPI_NORM;
- end;
- 2: begin
- cpi := CPI_ELON;
- lpi := LPI_NORM;
- end;
- else: ;
- end; { case }
- set_size;
- end
- { bold, italics, and underline switches }
- else if msg[4] = pri_bold then begin
- bold := xor(bold,true);
- Menu_Check(the_menu,pri_bold,bold);
- end
- else if msg[4] = pri_ital then begin
- ital := xor(ital,true);
- Menu_Check(the_menu,pri_ital,ital);
- end
- else if msg[4] = pri_underline then begin
- underline := xor(underline,true);
- Menu_Check(the_menu,pri_underline,underline);
- end;
-
- end { begin - style_title }
- { size of label }
- else if msg[3] = siz_title then begin
- if msg[4] in [siz_small..siz_other] then begin
- Menu_Check(the_menu,label_size,FALSE);
- label_size := msg[4];
- Menu_Check(the_menu,label_size,TRUE);
-
- case (msg[4] - siz_small) of
- 0:begin
- label_len := 1.0;
- label_wid := 3.5;
- end;
- 1:begin
- label_len := 1.5;
- label_wid := 4.0;
- end;
- 2:begin
- label_len := 2.75;
- label_wid := 2.75;
- end;
- 3: get_lab_size(label_wid,label_len);
- else : ;
- end; { case }
- set_size;
- end; { if }
- end; { begin - siz_title }
-
- UNTIL (msg[3] = lab_title) and (msg[4] = lab_quit) ;
-
- if C_Prnos then
- send_control(SW_RESET);
- Erase_menu(the_menu);
- Delete_menu(the_menu);
-
- Exit_Gem ;
- END ;
- END. { Thats all folks }
-